<!DOCTYPE html>
<html>
<head>
    <title>Worker timeout example</title>
    <meta charset="UTF-8">
    <script type="text/javascript">
        function fire_back_to_back_timers(combo)
        {
            var nworker = new Worker('hwww8.js');

            nworker.addEventListener('message', function(e) {
                console.log('Worker said: ', e.data);
            }, false);
            nworker.postMessage(combo); // Send data to our worker.
        }
        
        function fire_back_to_back_timers_on_window()
        {
            var h1 = setTimeout(function () { console.log("Hello1-in one second"); }, 1000);
            //clearInterval(h1);
            var h2 = setTimeout(function () { console.log("Hello2-in one second"); }, 1000);            
        }
    </script>
</head>
<body>
    <input type="button" onclick="javascript:fire_back_to_back_timers('timecombo1');" value="Fire back to back(1sec,2sec) timers in Worker!!"></input><BR/>    
    <input type="button" onclick="javascript:fire_back_to_back_timers('timecombo2');" value="Fire back to back(2sec,1sec) timers in Worker!!"></input><BR/>
    <input type="button" onclick="javascript:fire_back_to_back_timers('timecombo3');" value="Fire back to back(3sec,2sec,1sec) timers in Worker!!"></input><BR/>
    <input type="button" onclick="javascript:fire_back_to_back_timers('timecombo4');" value="Fire back to back(1sec,2sec,3sec) timers in Worker!!"></input><BR/>
    <input type="button" onclick="javascript:fire_back_to_back_timers_on_window();" value="Fire back to back timers in Window!!"></input><BR/>    
    <div id="status">
        
    </div>
</body>
</html>